< previous page page_418 next page >

Page 418
source to the target. It does this by providing the methods needed to store, retrieve, and analyze the data. Table 15.3 lists the property and methods used by the DataObject object.
TABLE 15.3. THE METHODS AND PROPERTIES OF THEDataObject.
CategoryItemDescription
PropertyFilesHolds the names of files dragged to or from the Windows Explorer.
MethodsClearClears the content of the DataObject object.
GetDataRetrieves data from the DataObject object.
GetFormatDetermines if a specified data format is available in the DataObject object.
SetDataPlaces data into the DataObject or sets a specified format.

These methods enable you to manage the data in the DataObject only for the controls in your application. The three important methods are the GetData, SetData, and GetFormat. The first two give you the ability to put data into the DataObject or to retrieve the data it contains. The last one enables you to check the format of the data before you process it, in case the data isn't valid for the target control (such as text being dropped on a picture box). All three methods use the same constants that are listed in Table 15.4 to test or set the format of the data.
TABLE 15.4. OLE DRAG AND DROP VISUAL BASIC-SUPPLIED CONSTANTS.
ConstantValueMeaning
vbCFText1Text
vbCFBitmap2Bitmap (.BMP)
vbCFMetafile3Metafile (.WMF)
vbCFEMetafile14Enhanced metafile (.EMF)
vbCFDIB8Device-independent bitmap (.DIB or .BMP)
vbCFPalette9Color palette
vbCFFiles15List of files
vbCFRTF16639Rich text format (.RTF)

 
< previous page page_418 next page >

If you like this book, buy it!